import {find} from '@/services/AdminUser';
import {setRefault} from '@/utils/Base';
import { message } from 'antd';
const AdminUserModel = {
  namespace: 'AdminUser',
  state: {
    refaultData:{},
  },
  effects: {
    *find({ payload,callback }, { call, put }) {
      const response = yield call( find , payload );
      yield put({
        type:'saveFind',
        payload:response,
      });
      (callback && typeof(callback) === "function") && callback(response);
    }
  },
  reducers: {
    save( state , {payload} ){
      //console.log('action',payload);
      return { ...state,menuData:payload.data};
    },
    changeNotifyCount(
      state = {
        currentUser: {},
      },
      action,
    ) {
      return {
        ...state,
        currentUser: {
          ...state.currentUser
        },
      };
    },
  },
};
export default AdminUserModel;
